// 定义设计规范变量
@color-main-text: #303133;
@color-regular-text: #606266;
@color-secondary-text: #909399;
@color-placeholder: #c0c4cc;
@color-theme: #19be6b;
@color-theme-dark: #18b566;
@color-danger: #f56c6c;
@color-warning: #f9ae3d;

@font-size-xl: 28rpx;
@font-size-lg: 26rpx;
@font-size-md: 24rpx;
@font-size-sm: 22rpx;

page {
  --td-tab-item-active-color: @color-theme;
}

.exchange-container {
  padding: 32rpx;
}

// 1. 积分卡片
.points-card {
  position: relative;
  padding: 40rpx;
  border-radius: 20rpx;
  background-image: linear-gradient(135deg, @color-theme-dark, @color-theme);
  color: #fff;
  margin-bottom: 40rpx;

  .details-btn {
    position: absolute;
    top: 30rpx;
    right: 30rpx;
    font-size: @font-size-sm;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8rpx 16rpx;
    border-radius: 30rpx;
    display: flex;
    align-items: center;
  }

  .points-label {
    font-size: @font-size-md;
    width: 30%;
    opacity: 0.8;
  }

  .points-value {
    font-size: 72rpx;
    font-weight: bold;
    margin: 10rpx 0;
    letter-spacing: 2rpx;
  }

  .points-equivalent {
    font-size: @font-size-lg;
    opacity: 0.9;
  }

  .points-rate-info {
    margin-top: 20rpx;
    font-size: @font-size-sm;
    opacity: 0.7;
    border-top: 1rpx solid rgba(255, 255, 255, 0.2);
    padding-top: 20rpx;
  }
}

// 2. 兑换专区
.section-title {
  font-size: @font-size-xl;
  color: @color-main-text;
  font-weight: bold;
  margin-bottom: 20rpx;
}

.item-list {
  .item-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 30rpx;
    border-radius: 16rpx;
    margin-bottom: 24rpx;
    transition: all 0.2s ease-in-out;

    &:active {
      transform: scale(0.98);
      box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.08);
    }

    &.is-disabled {
      opacity: 0.6;

      .item-points {
        color: @color-secondary-text;
      }
    }

    .item-info {
      flex: 1;
      margin-right: 20rpx;

      .item-header {
        display: flex;
        align-items: center;
        margin-bottom: 10rpx;

        .item-name {
          font-size: @font-size-lg;
          color: @color-main-text;
          font-weight: 500;
          margin-right: 12rpx;
        }
      }

      .item-desc {
        font-size: @font-size-sm;
        color: @color-regular-text;
        margin-bottom: 16rpx;
      }

      .item-meta {
        font-size: @font-size-sm;
        color: @color-secondary-text;
        display: flex;
        gap: 20rpx;
      }
    }

    .item-action {
      text-align: right;

      .item-points {
        font-size: @font-size-lg;
        color: @color-danger;
        font-weight: bold;
        margin-bottom: 12rpx;
      }

      .exchange-btn {
        --button-primary-background-color: @color-theme;
        --button-primary-border-color: @color-theme;
      }
    }
  }
}

// 3. 兑换明细弹窗
.history-list {
  padding: 24rpx;

  .history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24rpx 0;
    border-bottom: 1rpx solid #ebedf0;

    &:last-child {
      border-bottom: none;
    }

    .history-info {
      .history-title {
        color: @color-main-text;
        font-size: @font-size-md;
      }

      .history-time {
        color: @color-secondary-text;
        font-size: @font-size-sm;
        margin-top: 8rpx;
      }
    }

    .history-amount {
      font-size: @font-size-lg;
      font-weight: 500;

      &.is-expense {
        color: @color-danger;
      }

      &.is-income {
        color: @color-theme;
      }
    }
  }
}

// 4. 兑换数量弹窗
.exchange-dialog {
  padding: 40rpx 32rpx;

  .dialog-title {
    font-size: @font-size-xl;
    color: @color-main-text;
    text-align: center;
    font-weight: bold;
    margin-bottom: 40rpx;
  }

  .dialog-cost {
    text-align: center;
    color: @color-regular-text;
    font-size: @font-size-sm;
    margin: 20rpx 0 40rpx;

    .cost-value {
      color: @color-danger;
      font-weight: bold;
    }
  }

  .dialog-actions {
    display: flex;
    gap: 20rpx;
    justify-content: flex-end;
    .action-btn {
      --button-default-height: 88rpx;
      --button-primary-background-color: @color-theme;
      --button-primary-border-color: @color-theme;
    }
  }
}